package cn.slipi.service.service.impl;

import cn.slipi.service.entity.TOrder;
import cn.slipi.service.dao.TOrderMapper;
import cn.slipi.service.service.TOrderService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 订单表 服务实现类
 * </p>
 *
 * @author lee
 * @since 2021-05-10
 */
@Service
public class TOrderServiceImpl extends ServiceImpl<TOrderMapper, TOrder> implements TOrderService {

    @Override
    public TOrder getOrderByNo(String orderNo) {
        QueryWrapper<TOrder> orderQueryWrapper = new QueryWrapper<>();
        orderQueryWrapper.eq("order_no", orderNo);
        orderQueryWrapper.eq("status", 1);
        return this.baseMapper.selectOne(orderQueryWrapper);
    }
}
